if(!AmCharts.translations["export"]){AmCharts.translations["export"]={}}if(!AmCharts.translations["export"]["en"]){AmCharts.translations["export"]["en"]={"fallback.save.text":"CTRL + C to copy the data into the clipboard.","fallback.save.image":"Rightclick -> Save picture as... to save the image.","capturing.delayed.menu.label":"{{duration}}","capturing.delayed.menu.title":"Click to cancel","menu.label.print":"Print","menu.label.undo":"Undo","menu.label.redo":"Redo","menu.label.cancel":"Cancel","menu.label.save.image":"Download as ...","menu.label.save.data":"Save as ...","menu.label.draw":"Annotate ...","menu.label.draw.change":"Change ...","menu.label.draw.add":"Add ...","menu.label.draw.shapes":"Shape ...","menu.label.draw.colors":"Color ...","menu.label.draw.widths":"Size ...","menu.label.draw.opacities":"Opacity ...","menu.label.draw.text":"Text","menu.label.draw.modes":"Mode ...","menu.label.draw.modes.pencil":"Pencil","menu.label.draw.modes.line":"Line","menu.label.draw.modes.arrow":"Arrow","label.saved.from":"Saved from: "}}(function(){AmCharts["export"]=function(e,t){var a;var i={name:"export",version:"1.4.66",libs:{async:true,autoLoad:true,reload:false,resources:["fabric.js/fabric.min.js","FileSaver.js/FileSaver.min.js",{"jszip/jszip.min.js":["xlsx/xlsx.min.js"],"pdfmake/pdfmake.min.js":["pdfmake/vfs_fonts.js"]}],namespaces:{"pdfmake.min.js":"pdfMake","jszip.min.js":"JSZip","xlsx.min.js":"XLSX","fabric.min.js":"fabric","FileSaver.min.js":"saveAs"},loadTimeout:1e4},config:{},setup:{chart:e,hasBlob:false,wrapper:false,isIE:!!window.document.documentMode,IEversion:window.document.documentMode,hasTouch:typeof window.Touch=="object",focusedMenuItem:undefined},drawing:{enabled:false,undos:[],redos:[],buffer:{position:{x1:0,y1:0,x2:0,y2:0,xD:0,yD:0}},handler:{undo:function(e,t){var a=i.drawing.undos.pop();if(a){a.selectable=true;i.drawing.redos.push(a);if(a.action=="added"){i.setup.fabric.remove(a.target)}var r=JSON.parse(a.state);a.target.set(r);if(a.target instanceof fabric.Group){i.drawing.handler.change({color:r.cfg.color,width:r.cfg.width,opacity:r.cfg.opacity},true,a.target)}i.setup.fabric.renderAll();if(a.state==a.target.recentState&&!t){i.drawing.handler.undo(a,true)}}},redo:function(e,t){var a=i.drawing.redos.pop();if(a){a.selectable=true;i.drawing.undos.push(a);if(a.action=="added"){i.setup.fabric.add(a.target)}var r=JSON.parse(a.state);a.target.recentState=a.state;a.target.set(r);if(a.target instanceof fabric.Group){i.drawing.handler.change({color:r.cfg.color,width:r.cfg.width,opacity:r.cfg.opacity},true,a.target)}i.setup.fabric.renderAll();if(a.action=="addified"){i.drawing.handler.redo()}}},done:function(e){i.drawing.enabled=false;i.drawing.buffer.enabled=false;i.drawing.undos=[];i.drawing.redos=[];i.createMenu(i.config.menu);i.setup.fabric.deactivateAll();if(i.setup.wrapper){i.setup.chart.containerDiv.removeChild(i.setup.wrapper);i.setup.wrapper=false}},add:function(e){var t=i.deepMerge({top:i.setup.fabric.height/2,left:i.setup.fabric.width/2},e||{});var a=t.url.indexOf(".svg")!=-1?fabric.loadSVGFromURL:fabric.Image.fromURL;a(t.url,function(e,a){var r=a!==undefined?fabric.util.groupSVGElements(e,a):e;var n=false;if(r.height>i.setup.fabric.height||r.width>i.setup.fabric.width){n=i.setup.fabric.height/2/r.height}if(t.top>i.setup.fabric.height){t.top=i.setup.fabric.height/2}if(t.left>i.setup.fabric.width){t.left=i.setup.fabric.width/2}i.drawing.buffer.isDrawing=true;r.set({originX:"center",originY:"center",top:t.top,left:t.left,width:n?r.width*n:r.width,height:n?r.height*n:r.height,fill:i.drawing.color});i.setup.fabric.add(r)})},change:function(e,t,a){var r=i.deepMerge({},e||{});var n,s,o;var l=a||i.drawing.buffer.target;var f=l?l._objects?l._objects:[l]:null;if(r.mode){i.drawing.mode=r.mode}if(r.width){i.drawing.width=r.width;i.drawing.fontSize=r.fontSize=r.width*3;if(i.drawing.width==1){i.drawing.fontSize=r.fontSize=i.defaults.fabric.drawing.fontSize}}if(r.fontSize){i.drawing.fontSize=r.fontSize}if(r.color){i.drawing.color=r.color}if(r.opacity){i.drawing.opacity=r.opacity}o=i.getRGBA(i.drawing.color);o.pop();o.push(i.drawing.opacity);i.drawing.color="rgba("+o.join()+")";i.setup.fabric.freeDrawingBrush.color=i.drawing.color;i.setup.fabric.freeDrawingBrush.width=i.drawing.width;if(l){n=JSON.parse(l.recentState).cfg;if(n){r.color=r.color||n.color;r.width=r.width||n.width;r.opacity=r.opacity||n.opacity;r.fontSize=r.fontSize||n.fontSize;o=i.getRGBA(r.color);o.pop();o.push(r.opacity);r.color="rgba("+o.join()+")"}for(s=0;s<f.length;s++){if(f[s]instanceof fabric.Text||f[s]instanceof fabric.PathGroup||f[s]instanceof fabric.Triangle){if(r.color||r.opacity){f[s].set({fill:r.color})}if(r.fontSize){f[s].set({fontSize:r.fontSize})}}else if(f[s]instanceof fabric.Path||f[s]instanceof fabric.Line){if(l instanceof fabric.Group){if(r.color||r.opacity){f[s].set({stroke:r.color})}}else{if(r.color||r.opacity){f[s].set({stroke:r.color})}if(r.width){f[s].set({strokeWidth:r.width})}}}}if(!t){n=JSON.stringify(i.deepMerge(l.saveState().originalState,{cfg:{color:r.color,width:r.width,opacity:r.opacity}}));l.recentState=n;i.drawing.redos=[];i.drawing.undos.push({action:"modified",target:l,state:n})}i.setup.fabric.renderAll()}},text:function(e){var t=i.deepMerge({text:i.i18l("menu.label.draw.text"),top:i.setup.fabric.height/2,left:i.setup.fabric.width/2,fontSize:i.drawing.fontSize,fontFamily:i.setup.chart.fontFamily||"Verdana",fill:i.drawing.color},e||{});t.click=function(){};var a=new fabric.IText(t.text,t);i.drawing.buffer.isDrawing=true;i.setup.fabric.add(a);i.setup.fabric.setActiveObject(a);a.selectAll();a.enterEditing();return a},line:function(e){var t=i.deepMerge({x1:i.setup.fabric.width/2-i.setup.fabric.width/10,x2:i.setup.fabric.width/2+i.setup.fabric.width/10,y1:i.setup.fabric.height/2,y2:i.setup.fabric.height/2,angle:90,strokeLineCap:i.drawing.lineCap,arrow:i.drawing.arrow,color:i.drawing.color,width:i.drawing.width,group:[]},e||{});var a,r,n,s;var o=new fabric.Line([t.x1,t.y1,t.x2,t.y2],{stroke:t.color,strokeWidth:t.width,strokeLineCap:t.strokeLineCap});t.group.push(o);if(t.arrow){t.angle=t.angle?t.angle:i.getAngle(t.x1,t.y1,t.x2,t.y2);if(t.arrow=="start"){n=t.y1+t.width/2;s=t.x1+t.width/2}else if(t.arrow=="middle"){n=t.y2+t.width/2-(t.y2-t.y1)/2;s=t.x2+t.width/2-(t.x2-t.x1)/2}else{n=t.y2+t.width/2;s=t.x2+t.width/2}r=new fabric.Triangle({top:n,left:s,fill:t.color,height:t.width*7,width:t.width*7,angle:t.angle,originX:"center",originY:"bottom"});t.group.push(r)}i.drawing.buffer.isDrawing=true;if(t.action!="config"){if(t.arrow){var l=new fabric.Group(t.group);l.set({cfg:t,fill:t.color,action:t.action,selectable:true,known:t.action=="change"});if(t.action=="change"){i.setup.fabric.setActiveObject(l)}i.setup.fabric.add(l);return l}else{i.setup.fabric.add(o);return o}}else{for(a=0;a<t.group.length;a++){i.setup.fabric.add(t.group[a])}}return t}}},defaults:{position:"top-right",fileName:"amCharts",action:"download",overflow:true,path:(e.path||"")+"plugins/export/",formats:{JPG:{mimeType:"image/jpg",extension:"jpg",capture:true},PNG:{mimeType:"image/png",extension:"png",capture:true},SVG:{mimeType:"text/xml",extension:"svg",capture:true},PDF:{mimeType:"application/pdf",extension:"pdf",capture:true},CSV:{mimeType:"text/plain",extension:"csv"},JSON:{mimeType:"text/plain",extension:"json"},XLSX:{mimeType:"application/octet-stream",extension:"xlsx"}},fabric:{backgroundColor:"#FFFFFF",removeImages:true,forceRemoveImages:false,selection:false,loadTimeout:5e3,drawing:{enabled:true,arrow:"end",lineCap:"butt",mode:"pencil",modes:["pencil","line","arrow"],color:"#000000",colors:["#000000","#FFFFFF","#FF0000","#00FF00","#0000FF"],shapes:["11.svg","14.svg","16.svg","17.svg","20.svg","27.svg"],width:1,fontSize:11,widths:[1,5,10,15],opacity:1,opacities:[1,.8,.6,.4,.2],menu:undefined,autoClose:true},border:{fill:"",fillOpacity:0,stroke:"#000000",strokeWidth:1,strokeOpacity:1}},pdfMake:{images:{},pageOrientation:"portrait",pageMargins:40,pageOrigin:true,pageSize:"A4",pageSizes:{"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]}},menu:undefined,divId:null,menuReviver:null,menuWalker:null,fallback:true,keyListener:true,fileListener:true,compress:true,debug:false},i18l:function(e,t){var a=t?t:i.setup.chart.language?i.setup.chart.language:"en";var r=AmCharts.translations[i.name][a]||AmCharts.translations[i.name]["en"];return r[e]||e},download:function(e,t,a){if(window.saveAs&&i.setup.hasBlob){var r=i.toBlob({data:e,type:t},function(e){saveAs(e,a)})}else if(i.config.fallback&&t=="text/plain"){var n=document.createElement("div");var s=document.createElement("div");var o=document.createElement("textarea");s.innerHTML=i.i18l("fallback.save.text");n.appendChild(s);n.appendChild(o);s.setAttribute("class","amcharts-export-fallback-message");n.setAttribute("class","amcharts-export-fallback");i.setup.chart.containerDiv.appendChild(n);o.setAttribute("readonly","");o.value=e;o.focus();o.select();i.createMenu([{"class":"export-main export-close",label:"Done",click:function(){i.createMenu(i.config.menu);i.setup.chart.containerDiv.removeChild(n)}}])}else if(i.config.fallback&&t.split("/")[0]=="image"){var n=document.createElement("div");var s=document.createElement("div");var l=i.toImage({data:e});s.innerHTML=i.i18l("fallback.save.image");n.appendChild(s);n.appendChild(l);s.setAttribute("class","amcharts-export-fallback-message");n.setAttribute("class","amcharts-export-fallback");i.setup.chart.containerDiv.appendChild(n);i.createMenu([{"class":"export-main export-close",label:"Done",click:function(){i.createMenu(i.config.menu);i.setup.chart.containerDiv.removeChild(n)}}])}else{throw new Error("Unable to create file. Ensure saveAs (FileSaver.js) is supported.")}return e},loadResource:function(e,t){var a,r,n,s,o,l;var f=e.indexOf("//")!=-1?e:[i.libs.path,e].join("");var d=function u(){if(t){for(a=0;a<t.length;a++){i.loadResource(t[a])}}};if(e.indexOf(".js")!=-1){n=document.createElement("script");n.setAttribute("type","text/javascript");n.setAttribute("src",f);if(i.libs.async){n.setAttribute("async","")}}else if(e.indexOf(".css")!=-1){n=document.createElement("link");n.setAttribute("type","text/css");n.setAttribute("rel","stylesheet");n.setAttribute("href",f)}for(a=0;a<document.head.childNodes.length;a++){s=document.head.childNodes[a];o=s?s.src||s.href:false;l=s?s.tagName:false;if(s&&o&&o.indexOf(e)!=-1){if(i.libs.reload){document.head.removeChild(s)}r=true;break}}for(a in i.libs.namespaces){var c=i.libs.namespaces[a];var o=e.toLowerCase();var s=a.toLowerCase();if(o.indexOf(s)!=-1&&window[c]!==undefined){r=true;break}}if(!r||i.libs.reload){n.addEventListener("load",d);n.addEventListener("error",function(){i.handleLog(["amCharts[export]: Loading error on ",this.src||this.href].join(""))});document.head.appendChild(n);if(!i.listenersToRemove){i.listenersToRemove=[]}i.listenersToRemove.push({node:n,method:d,event:"load"})}},loadDependencies:function(){var e,t;if(i.libs.autoLoad){for(e=0;e<i.libs.resources.length;e++){if(i.libs.resources[e]instanceof Object){for(t in i.libs.resources[e]){i.loadResource(t,i.libs.resources[e][t])}}else{i.loadResource(i.libs.resources[e])}}}},pxToNumber:function(e,t){if(!e&&t){return undefined}return Number(String(e).replace("px",""))||0},numberToPx:function(e){return String(e)+"px"},cloneObject:function(e){var t,a,r,n,s;t=Array.isArray(e)?[]:{};for(r in e){a=e[r];n=typeof a==="object";s=a instanceof Date;t[r]=n&&!s?i.cloneObject(a):a}return t},deepMerge:function(e,t,a){var r,n,s=t instanceof Array?"array":"object";if(!(e instanceof Object||e instanceof Array)){return e}for(r in t){if(s=="array"&&isNaN(r)){continue}n=t[r];if(e&&e[r]==undefined||a){if(n instanceof Array){e[r]=new Array}else if(n instanceof Function){e[r]=function(){}}else if(n instanceof Date){e[r]=new Date}else if(n instanceof Object){e[r]=new Object}else if(n instanceof Number){e[r]=new Number}else if(n instanceof String){e[r]=new String}}if((n instanceof Object||n instanceof Array)&&!(n instanceof Function||n instanceof Date||i.isElement(n))&&r!="chart"&&r!="scope"){i.deepMerge(e[r],n,a)}else{if(e instanceof Array&&!a){e.push(n)}else if(e){e[r]=n}}}return e},isElement:function(e){return e instanceof Object&&e&&e.nodeType===1},isHashbanged:function(e){var t=String(e).replace(/\"/g,"");return t.slice(0,3)=="url"?t.slice(t.indexOf("#")+1,t.length-1):false},isPressed:function(e){if(e.type=="mousemove"&&e.which===1){}else if(e.type=="touchmove"||e.buttons===1||e.button===1||e.which===1){i.drawing.buffer.isPressed=true}else{i.drawing.buffer.isPressed=false}return i.drawing.buffer.isPressed},removeImage:function(e){if(e){if(i.config.fabric.forceRemoveImages){return true}else if(i.config.fabric.removeImages&&i.isTainted(e)){return true}else if(i.setup.isIE&&(i.setup.IEversion==10||i.setup.IEversion==11)&&e.toLowerCase().indexOf(".svg")!=-1){return true}}return false},isTainted:function(e){var t=String(window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));if(e){if(t.indexOf(":\\")!=-1||e.indexOf(":\\")!=-1||t.indexOf("file://")!=-1||e.indexOf("file://")!=-1){return true}else if(e.indexOf("//")!=-1&&e.indexOf(t.replace(/.*:/,""))==-1){return true}}return false},isSupported:function(){if(!i.config.enabled){return false}if(i.setup.isIE&&i.setup.IEversion<=9){if(!Array.prototype.indexOf||!document.head||i.config.fallback===false){return false}}return true},getAngle:function(e,t,a,i){var r=a-e;var n=i-t;var s;if(r==0){if(n==0){s=0}else if(n>0){s=Math.PI/2}else{s=Math.PI*3/2}}else if(n==0){if(r>0){s=0}else{s=Math.PI}}else{if(r<0){s=Math.atan(n/r)+Math.PI}else if(n<0){s=Math.atan(n/r)+2*Math.PI}else{s=Math.atan(n/r)}}return s*180/Math.PI},gatherAttribute:function(e,t,a,r){var n,r=r?r:0,a=a?a:3;if(e){n=e.getAttribute(t);if(!n&&r<a){return i.gatherAttribute(e.parentNode,t,a,r+1)}}return n},gatherClassName:function(e,t,a,r){var n,r=r?r:0,a=a?a:3;if(i.isElement(e)){n=(e.getAttribute("class")||"").split(" ").indexOf(t)!=-1;if(!n&&r<a){return i.gatherClassName(e.parentNode,t,a,r+1)}else if(n){n=e}}return n},gatherElements:function(e,t,a){var r,n;for(r=0;r<e.children.length;r++){var s=e.children[r];if(s.tagName=="clipPath"){var o={};var l=fabric.parseTransformAttribute(i.gatherAttribute(s,"transform"));for(n=0;n<s.childNodes.length;n++){s.childNodes[n].setAttribute("fill","transparent");o={x:i.pxToNumber(s.childNodes[n].getAttribute("x")),y:i.pxToNumber(s.childNodes[n].getAttribute("y")),width:i.pxToNumber(s.childNodes[n].getAttribute("width")),height:i.pxToNumber(s.childNodes[n].getAttribute("height"))}}e.clippings[s.id]={svg:s,bbox:o,transform:l}}else if(s.tagName=="pattern"){var f={node:s,source:s.getAttribute("xlink:href"),width:Number(s.getAttribute("width")),height:Number(s.getAttribute("height")),repeat:"repeat",offsetX:0,offsetY:0};for(n=0;n<s.childNodes.length;n++){if(s.childNodes[n].tagName=="rect"){f.fill=s.childNodes[n].getAttribute("fill")}else if(s.childNodes[n].tagName=="image"){var d=fabric.parseAttributes(s.childNodes[n],fabric.SHARED_ATTRIBUTES);if(d.transformMatrix){f.offsetX=d.transformMatrix[4];f.offsetY=d.transformMatrix[5]}}}if(i.removeImage(f.source)){e.patterns[s.id]=f.fill?f.fill:"transparent"}else{e.patterns[f.node.id]=f}}else if(s.tagName=="image"){a.included++;fabric.Image.fromURL(s.getAttribute("xlink:href"),function(e){a.loaded++})}else{var d=["fill","stroke"];for(n=0;n<d.length;n++){var c=d[n];var u=s.getAttribute(c);var p=i.getRGBA(u);var g=i.isHashbanged(u);if(u&&!p&&!g){s.setAttribute(c,"none");s.setAttribute(c+"-opacity","0")}}}}return e},getRGBA:function(e,t){if(e!="none"&&e!="transparent"&&!i.isHashbanged(e)){e=new fabric.Color(e);if(e._source){return t?e:e.getSource()}}return false},gatherPosition:function(e,t){var a=i.drawing.buffer.position;var r=fabric.util.invertTransform(i.setup.fabric.viewportTransform);var n;if(e.type=="touchmove"){if("touches"in e){e=e.touches[0]}else if("changedTouches"in e){e=e.changedTouches[0]}}n=fabric.util.transformPoint(i.setup.fabric.getPointer(e,true),r);if(t==1){a.x1=n.x;a.y1=n.y}a.x2=n.x;a.y2=n.y;a.xD=a.x1-a.x2<0?(a.x1-a.x2)*-1:a.x1-a.x2;a.yD=a.y1-a.y2<0?(a.y1-a.y2)*-1:a.y1-a.y2;return a},modifyFabric:function(){fabric.ElementsParser.prototype.resolveGradient=function(e,t){var a=e.get(t);if(!/^url\(/.test(a)){return}var r=a.slice(a.indexOf("#")+1,a.length-1);if(fabric.gradientDefs[this.svgUid][r]){var n=fabric.Gradient.fromElement(fabric.gradientDefs[this.svgUid][r],e);if(n.coords.y1&&i.setup.chart.type!="pie"){n.coords.y2=n.coords.y1*-1;n.coords.y1=0}e.set(t,n)}};fabric.Text.fromElement=function(e,t){if(!e){return null}var a=fabric.parseAttributes(e,fabric.Text.ATTRIBUTE_NAMES);t=fabric.util.object.extend(t?fabric.util.object.clone(t):{},a);t.top=t.top||0;t.left=t.left||0;if("dx"in a){t.left+=a.dx}if("dy"in a){t.top+=a.dy}if(!("fontSize"in t)){t.fontSize=fabric.Text.DEFAULT_SVG_FONT_SIZE}if(!t.originX){t.originX="left"}var i="";var r=[];if(!("textContent"in e)){if("firstChild"in e&&e.firstChild!==null){if("data"in e.firstChild&&e.firstChild.data!==null){r.push(e.firstChild.data)}}}else if(e.childNodes){for(var n=0;n<e.childNodes.length;n++){r.push(e.childNodes[n].textContent)}}else{r.push(e.textContent)}i=r.join("\n");var s=new fabric.Text(i,t),o=0;if(s.originX==="left"){o=s.getWidth()/2}if(s.originX==="right"){o=-s.getWidth()/2}if(r.length>1){s.set({left:s.getLeft()+o,top:s.getTop()+s.fontSize*(r.length-1)*(.18+s._fontSizeFraction),textAlign:t.originX,lineHeight:r.length>1?.965:1.16})}else{s.set({left:s.getLeft()+o,top:s.getTop()-s.getHeight()/2+s.fontSize*(.18+s._fontSizeFraction)})}return s}},capture:function(e,t){var a;var r=i.deepMerge(i.deepMerge({},i.config.fabric),e||{});var n=[];var s={x:0,y:0,pX:0,pY:0,lX:0,lY:0,width:i.setup.chart.divRealWidth,height:i.setup.chart.divRealHeight};var o={loaded:0,included:0};var l={items:[],width:0,height:0,maxWidth:0,maxHeight:0};if(!i.handleNamespace("fabric",{scope:this,cb:i.capture,args:arguments})){return false}i.modifyFabric();i.handleCallback(r.beforeCapture,r);var f=i.setup.chart.containerDiv.getElementsByTagName("svg");for(a=0;a<f.length;a++){var d={svg:f[a],parent:f[a].parentNode,children:f[a].getElementsByTagName("*"),offset:{x:0,y:0},patterns:{},clippings:{},has:{legend:false,panel:false,scrollbar:false}};d.has.legend=i.gatherClassName(d.parent,i.setup.chart.classNamePrefix+"-legend-div",1);d.has.panel=i.gatherClassName(d.parent,i.setup.chart.classNamePrefix+"-stock-panel-div");d.has.scrollbar=i.gatherClassName(d.parent,i.setup.chart.classNamePrefix+"-scrollbar-chart-div");d=i.gatherElements(d,r,o);n.push(d)}if(i.config.legend){if(i.setup.chart.type=="stock"){for(a=0;a<i.setup.chart.panels.length;a++){if(i.setup.chart.panels[a].stockLegend&&i.setup.chart.panels[a].stockLegend.divId){l.items.push(i.setup.chart.panels[a].stockLegend)}}}else if(i.setup.chart.legend&&i.setup.chart.legend.divId){l.items.push(i.setup.chart.legend)}for(a=0;a<l.items.length;a++){var c=l.items[a];var d={svg:c.container.container,parent:c.container.container.parentNode,children:c.container.container.getElementsByTagName("*"),offset:{x:0,y:0},legend:{id:a,type:["top","left"].indexOf(i.config.legend.position)!=-1?"unshift":"push",position:i.config.legend.position,width:i.config.legend.width?i.config.legend.width:c.container.div.offsetWidth,height:i.config.legend.height?i.config.legend.height:c.container.div.offsetHeight},patterns:{},clippings:{},has:{legend:false,panel:false,scrollbar:false}};l.width+=d.legend.width;l.height+=d.legend.height;l.maxWidth=d.legend.width>l.maxWidth?d.legend.width:l.maxWidth;l.maxHeight=d.legend.height>l.maxHeight?d.legend.height:l.maxHeight;d=i.gatherElements(d,r,o);n[d.legend.type](d)}if(["top","bottom"].indexOf(i.config.legend.position)!=-1){s.width=l.maxWidth>s.width?l.maxWidth:s.width;s.height+=l.height}else if(["left","right"].indexOf(i.config.legend.position)!=-1){s.width+=l.maxWidth;s.height=l.height>s.height?l.height:s.height}else{s.height+=l.height;s.width+=l.maxWidth}}i.drawing.enabled=r.drawing.enabled=r.action=="draw";i.drawing.buffer.enabled=i.drawing.enabled;i.setup.wrapper=document.createElement("div");i.setup.wrapper.setAttribute("class",i.setup.chart.classNamePrefix+"-export-canvas");i.setup.chart.containerDiv.appendChild(i.setup.wrapper);if(i.setup.chart.type=="stock"){var u={top:0,right:0,bottom:0,left:0};if(i.setup.chart.leftContainer){s.width-=i.setup.chart.leftContainer.offsetWidth;u.left=i.setup.chart.leftContainer.offsetWidth+i.setup.chart.panelsSettings.panelSpacing*2}if(i.setup.chart.rightContainer){s.width-=i.setup.chart.rightContainer.offsetWidth;u.right=i.setup.chart.rightContainer.offsetWidth+i.setup.chart.panelsSettings.panelSpacing*2}if(i.setup.chart.periodSelector&&["top","bottom"].indexOf(i.setup.chart.periodSelector.position)!=-1){s.height-=i.setup.chart.periodSelector.offsetHeight+i.setup.chart.panelsSettings.panelSpacing;u[i.setup.chart.periodSelector.position]+=i.setup.chart.periodSelector.offsetHeight+i.setup.chart.panelsSettings.panelSpacing}if(i.setup.chart.dataSetSelector&&["top","bottom"].indexOf(i.setup.chart.dataSetSelector.position)!=-1){s.height-=i.setup.chart.dataSetSelector.offsetHeight;u[i.setup.chart.dataSetSelector.position]+=i.setup.chart.dataSetSelector.offsetHeight}i.setup.wrapper.style.paddingTop=i.numberToPx(u.top);i.setup.wrapper.style.paddingRight=i.numberToPx(u.right);i.setup.wrapper.style.paddingBottom=i.numberToPx(u.bottom);i.setup.wrapper.style.paddingLeft=i.numberToPx(u.left)}i.setup.canvas=document.createElement("canvas");i.setup.wrapper.appendChild(i.setup.canvas);i.setup.fabric=new fabric.Canvas(i.setup.canvas,i.deepMerge({width:s.width,height:s.height,isDrawingMode:true},r));i.deepMerge(i.setup.fabric,r);i.deepMerge(i.setup.fabric.freeDrawingBrush,r.drawing);i.deepMerge(i.drawing,r.drawing);i.drawing.handler.change(r.drawing);i.setup.fabric.on("mouse:down",function(e){var t=i.gatherPosition(e.e,1);i.drawing.buffer.pressedTS=Number(new Date);i.isPressed(e.e);i.drawing.buffer.isDrawing=false;i.drawing.buffer.isDrawingTimer=setTimeout(function(){if(!i.drawing.buffer.isSelected){i.drawing.buffer.isDrawing=true}},200)});i.setup.fabric.on("mouse:move",function(e){var t=i.gatherPosition(e.e,2);i.isPressed(e.e);if(i.drawing.buffer.isPressed&&!i.drawing.buffer.isSelected){i.drawing.buffer.isDrawing=true;if(!i.drawing.buffer.line&&i.drawing.mode!="pencil"&&(t.xD>5||t.yD>5)){i.setup.fabric.isDrawingMode=false;i.setup.fabric._isCurrentlyDrawing=false;i.setup.fabric.freeDrawingBrush.onMouseUp();i.setup.fabric.remove(i.setup.fabric._objects.pop());i.drawing.buffer.line=i.drawing.handler.line({x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,arrow:i.drawing.mode=="line"?false:i.drawing.arrow,action:"config"})}}if(i.drawing.buffer.isSelected){i.setup.fabric.isDrawingMode=false}if(i.drawing.buffer.line){var r,n,s;var o=i.drawing.buffer.line;o.x2=t.x2;o.y2=t.y2;for(a=0;a<o.group.length;a++){r=o.group[a];if(r instanceof fabric.Line){r.set({x2:o.x2,y2:o.y2})}else if(r instanceof fabric.Triangle){o.angle=i.getAngle(o.x1,o.y1,o.x2,o.y2)+90;if(o.arrow=="start"){n=o.y1+o.width/2;s=o.x1+o.width/2}else if(o.arrow=="middle"){n=o.y2+o.width/2-(o.y2-o.y1)/2;s=o.x2+o.width/2-(o.x2-o.x1)/2}else{n=o.y2+o.width/2;s=o.x2+o.width/2}r.set({top:n,left:s,angle:o.angle})}}i.setup.fabric.renderAll()}});i.setup.fabric.on("mouse:up",function(e){if(!i.drawing.buffer.isDrawing){var t=i.setup.fabric.findTarget(e.e);if(t&&t.selectable){i.setup.fabric.setActiveObject(t)}}if(i.drawing.buffer.line){for(a=0;a<i.drawing.buffer.line.group.length;a++){i.drawing.buffer.line.group[a].remove()}delete i.drawing.buffer.line.action;delete i.drawing.buffer.line.group;i.drawing.handler.line(i.drawing.buffer.line)}i.drawing.buffer.line=false;i.drawing.buffer.hasLine=false;i.drawing.buffer.isPressed=false;clearTimeout(i.drawing.buffer.isDrawingTimer);i.drawing.buffer.isDrawing=false});i.setup.fabric.on("object:selected",function(e){i.drawing.buffer.isSelected=true;i.drawing.buffer.target=e.target;i.setup.fabric.isDrawingMode=false});i.setup.fabric.on("selection:cleared",function(e){i.drawing.buffer.target=false;if(i.drawing.buffer.isSelected){i.setup.fabric._isCurrentlyDrawing=false}i.drawing.buffer.isSelected=false;i.setup.fabric.isDrawingMode=true});i.setup.fabric.on("path:created",function(e){var t=e.path;if(!i.drawing.buffer.isDrawing||i.drawing.buffer.hasLine){i.setup.fabric.remove(t);i.setup.fabric.renderAll();return}});i.setup.fabric.on("object:added",function(e){var t=e.target;var a=i.deepMerge(t.saveState().originalState,{cfg:{color:i.drawing.color,width:i.drawing.width,opacity:i.drawing.opacity,fontSize:i.drawing.fontSize}});a=JSON.stringify(a);t.recentState=a;if(t.selectable&&!t.known){t.isAnnotation=true;i.drawing.undos.push({action:"added",target:t,state:a});i.drawing.undos.push({action:"addified",target:t,state:a});i.drawing.redos=[]}t.known=true;i.setup.fabric.isDrawingMode=true});i.setup.fabric.on("object:modified",function(e){var t=e.target;var a=JSON.parse(t.recentState);var r=i.deepMerge(t.saveState().originalState,{cfg:a.cfg});r=JSON.stringify(r);t.recentState=r;i.drawing.undos.push({action:"modified",target:t,state:r});i.drawing.redos=[]});i.setup.fabric.on("text:changed",function(e){var t=e.target;clearTimeout(t.timer);t.timer=setTimeout(function(){var e=JSON.stringify(t.saveState().originalState);t.recentState=e;i.drawing.redos=[];i.drawing.undos.push({action:"modified",target:t,state:e})},250)});if(i.drawing.enabled){i.setup.wrapper.setAttribute("class",i.setup.chart.classNamePrefix+"-export-canvas active");i.setup.wrapper.style.backgroundColor=r.backgroundColor;i.setup.wrapper.style.display="block"}else{i.setup.wrapper.setAttribute("class",i.setup.chart.classNamePrefix+"-export-canvas");i.setup.wrapper.style.display="none"}for(a=0;a<n.length;a++){var d=n[a];if(i.setup.chart.type=="stock"&&i.setup.chart.legendSettings.position){if(["top","bottom"].indexOf(i.setup.chart.legendSettings.position)!=-1){if(d.parent.style.top&&d.parent.style.left){d.offset.y=i.pxToNumber(d.parent.style.top);d.offset.x=i.pxToNumber(d.parent.style.left)}else{d.offset.x=s.x;d.offset.y=s.y;s.y+=i.pxToNumber(d.parent.style.height);if(d.has.panel){s.pY=i.pxToNumber(d.has.panel.style.marginTop);d.offset.y+=s.pY}else if(d.has.scrollbar){d.offset.y+=s.pY}}}else if(["left","right"].indexOf(i.setup.chart.legendSettings.position)!=-1){d.offset.y=i.pxToNumber(d.parent.style.top)+s.pY;d.offset.x=i.pxToNumber(d.parent.style.left)+s.pX;if(d.has.legend){s.pY+=i.pxToNumber(d.has.panel.style.height)+i.setup.chart.panelsSettings.panelSpacing}else if(d.has.scrollbar){d.offset.y-=i.setup.chart.panelsSettings.panelSpacing}}}else{if(d.parent.style.position=="absolute"){d.offset.absolute=true;d.offset.top=i.pxToNumber(d.parent.style.top);d.offset.right=i.pxToNumber(d.parent.style.right,true);d.offset.bottom=i.pxToNumber(d.parent.style.bottom,true);d.offset.left=i.pxToNumber(d.parent.style.left);d.offset.width=i.pxToNumber(d.parent.style.width);d.offset.height=i.pxToNumber(d.parent.style.height)}else if(d.parent.style.top&&d.parent.style.left){d.offset.y=i.pxToNumber(d.parent.style.top);d.offset.x=i.pxToNumber(d.parent.style.left)}else{if(d.legend){if(d.legend.position=="left"){s.x=l.maxWidth}else if(d.legend.position=="right"){d.offset.x=s.width-l.maxWidth}else if(d.legend.position=="top"){s.y+=d.legend.height}else if(d.legend.position=="bottom"){d.offset.y=s.height-l.height}d.offset.y+=s.lY;s.lY+=d.legend.height}else{d.offset.x=s.x;d.offset.y=s.y+s.pY;s.y+=i.pxToNumber(d.parent.style.height)}}if(d.has.legend&&d.has.panel&&d.has.panel.style.marginTop){s.y+=i.pxToNumber(d.has.panel.style.marginTop);d.offset.y+=i.pxToNumber(d.has.panel.style.marginTop)}else if(i.setup.chart.legend&&["left","right"].indexOf(i.setup.chart.legend.position)!=-1){d.offset.y=i.pxToNumber(d.parent.style.top);d.offset.x=i.pxToNumber(d.parent.style.left)}}fabric.parseSVGDocument(d.svg,function(e){return function(a,l){var f,d;var c=fabric.util.groupSVGElements(a,l);var u=[];var p={selectable:false,isCoreElement:true};if(e.offset.absolute){if(e.offset.bottom!==undefined){p.top=s.height-e.offset.height-e.offset.bottom}else{p.top=e.offset.top}if(e.offset.right!==undefined){p.left=s.width-e.offset.width-e.offset.right}else{p.left=e.offset.left}}else{p.top=e.offset.y;p.left=e.offset.x}for(f=0;f<c.paths.length;f++){var g=null;if(c.paths[f]){if(i.removeImage(c.paths[f]["xlink:href"])){continue}if(c.paths[f].fill instanceof Object){if(c.paths[f].fill.type=="radial"){if(["pie","gauge"].indexOf(i.setup.chart.type)==-1){c.paths[f].fill.coords.r2=c.paths[f].fill.coords.r1*-1;c.paths[f].fill.coords.r1=0;c.paths[f].set({opacity:c.paths[f].fillOpacity})}}}else if(g=i.isHashbanged(c.paths[f].fill)){if(e.patterns&&e.patterns[g]){var h=e.patterns[g];o.included++;fabric.Image.fromURL(h.source,function(e,t){return function(a){o.loaded++;a.set({top:e.offsetY,left:e.offsetX,width:e.width,height:e.height});if(i.setup.fabric._isRetinaScaling()){a.set({top:e.offsetY/2,left:e.offsetX/2,scaleX:.5,scaleY:.5})}var r=new fabric.StaticCanvas(undefined,{backgroundColor:e.fill,width:a.getWidth(),height:a.getHeight()});r.add(a);var n=new fabric.Pattern({source:r.getElement(),offsetX:c.paths[t].width/2,offsetY:c.paths[t].height/2,repeat:"repeat"});c.paths[t].set({fill:n,opacity:c.paths[t].fillOpacity})}}(h,f))}}if(g=i.isHashbanged(c.paths[f].clipPath)){if(e.clippings&&e.clippings[g]){(function(t,a){var i=c.paths[t].toSVG;c.paths[t].toSVG=function(t){return i.apply(this,[function(i){return t(i,e.clippings[a])}])}})(f,g);c.paths[f].set({clipTo:function(t,a){return function(r){var n=e.clippings[a];var s=this.transformMatrix||[1,0,0,1,0,0];var o={top:n.bbox.y,left:n.bbox.x,width:n.bbox.width,height:n.bbox.height};if(i.setup.chart.type=="map"){o.top+=n.transform[5];o.left+=n.transform[4]}if(n.bbox.x&&s[4]&&n.bbox.y&&s[5]){o.top-=s[5];o.left-=s[4]}if(i.setup.chart.smoothCustomBullets!==undefined&&this.className==i.setup.chart.classNamePrefix+"-graph-bullet"&&c.paths[t].svg.tagName=="image"){radius=n.svg.firstChild.rx.baseVal.value/2+2;r.beginPath();r.moveTo(o.left+radius,o.top);r.lineTo(o.left+o.width-radius,o.top);r.quadraticCurveTo(o.left+o.width,o.top,o.left+o.width,o.top+radius);r.lineTo(o.left+o.width,o.top+o.height-radius);r.quadraticCurveTo(o.left+o.width,o.top+o.height,o.left+o.width-radius,o.top+o.height);r.lineTo(o.left+radius,o.top+o.height);r.quadraticCurveTo(o.left,o.top+o.height,o.left,o.top+o.height-radius);r.lineTo(o.left,o.top+radius);r.quadraticCurveTo(o.left,o.top,o.left+radius,o.top);r.closePath()}else{r.rect(o.left,o.top,o.width,o.height)}}}(f,g)})}}}u.push(c.paths[f])}c.paths=u;p.top+=.5;p.left+=.5;c.set(p);i.setup.fabric.add(c);if(e.svg.parentNode&&e.svg.parentNode.getElementsByTagName){var m=e.svg.parentNode.getElementsByClassName(i.setup.chart.classNamePrefix+"-balloon-div");for(f=0;f<m.length;f++){if(r.balloonFunction instanceof Function){r.balloonFunction.apply(i,[m[f],e])}else{var b=m[f];var v=fabric.parseStyleAttribute(b);var w=fabric.parseStyleAttribute(b.childNodes[0]);var y=new fabric.Text(b.innerText||b.textContent||b.innerHTML,{
selectable:false,top:v.top+e.offset.y,left:v.left+e.offset.x,fill:w["color"],fontSize:w["fontSize"],fontFamily:w["fontFamily"],textAlign:w["text-align"],isCoreElement:true});i.setup.fabric.add(y)}}}if(e.svg.nextSibling&&e.svg.nextSibling.tagName=="A"){var b=e.svg.nextSibling;var v=fabric.parseStyleAttribute(b);var y=new fabric.Text(b.innerText||b.textContent||b.innerHTML,{selectable:false,top:v.top+e.offset.y,left:v.left+e.offset.x,fill:v["color"],fontSize:v["fontSize"],fontFamily:v["fontFamily"],opacity:v["opacity"],isCoreElement:true});if(!e.has.scrollbar){i.setup.fabric.add(y)}}n.pop();if(!n.length){var x=Number(new Date);var N=setInterval(function(){var e=Number(new Date);if(o.loaded==o.included||e-x>i.config.fabric.loadTimeout){clearTimeout(N);i.handleBorder(r);i.handleCallback(r.afterCapture,r);i.setup.fabric.renderAll();i.handleCallback(t,r)}},AmCharts.updateRate)}}}(d),function(e,t){var a;var n=i.gatherAttribute(e,"class");var s=i.gatherAttribute(e,"visibility");var o=i.gatherAttribute(e,"clip-path");t.className=String(n);t.classList=String(n).split(" ");t.clipPath=o;t.svg=e;var l=["fill","stroke"];for(a=0;a<l.length;a++){var f=l[a];var d=String(e.getAttribute(f)||"none");var c=Number(e.getAttribute(f+"-opacity")||"1");var u=i.getRGBA(d);if(s=="hidden"){t.opacity=0;c=0}if(u){u.pop();u.push(c);t[f]="rgba("+u.join()+")";t[f+i.capitalize("opacity")]=c}}i.handleCallback(r.reviver,t,e)})}},toCanvas:function(e,t){var a=i.deepMerge({},e||{});var r=i.setup.canvas;i.handleCallback(t,r,a);return r},toImage:function(e,t){var a=i.deepMerge({format:"png",quality:1,multiplier:i.config.multiplier},e||{});var r=a.data;var n=document.createElement("img");if(!i.handleNamespace("fabric",{scope:this,cb:i.toImage,args:arguments})){return false}if(!a.data){if(a.lossless||a.format=="svg"){r=i.toSVG(i.deepMerge(a,{getBase64:true}))}else{r=i.setup.fabric.toDataURL(a)}}n.setAttribute("src",r);i.handleCallback(t,n,a);return n},toBlob:function(e,t){var a=i.deepMerge({data:"empty",type:"text/plain"},e||{});var r;var n=/^data:.+;base64,(.*)$/.exec(a.data);if(n){a.data=n[0];a.type=a.data.slice(5,a.data.indexOf(",")-7);a.data=i.toByteArray({data:a.data.slice(a.data.indexOf(",")+1,a.data.length)})}if(a.getByteArray){r=a.data}else{r=new Blob([a.data],{type:a.type})}i.handleCallback(t,r,a);return r},toJPG:function(e,t){var a=i.deepMerge({format:"jpeg",quality:1,multiplier:i.config.multiplier},e||{});a.format=a.format.toLowerCase();var r;if(!i.handleNamespace("fabric",{scope:this,cb:i.toJPG,args:arguments})){return false}r=i.setup.fabric.toDataURL(a);i.handleCallback(t,r,a);return r},toPNG:function(e,t){var a=i.deepMerge({format:"png",quality:1,multiplier:i.config.multiplier},e||{});var r;if(!i.handleNamespace("fabric",{scope:this,cb:i.toPNG,args:arguments})){return false}r=i.setup.fabric.toDataURL(a);i.handleCallback(t,r,a);return r},toSVG:function(e,t){var a=[];var r=[];var n=i.deepMerge({compress:i.config.compress,reviver:function(e,t){var n=new RegExp(/\bstyle=(['"])(.*?)\1/);var s=n.exec(e)[0].slice(7,-1);var o=s.split(";");var l=[];for(i1=0;i1<o.length;i1++){if(o[i1]){var f=o[i1].replace(/\s/g,"").split(":");var d=f[0];var c=f[1];if(["fill","stroke"].indexOf(d)!=-1){c=i.getRGBA(c,true);if(c){var u="#"+c.toHex();var p=c._source[3];l.push([d,u].join(":"));l.push([d+"-opacity",p].join(":"))}else{l.push(o[i1])}}else if(d!="opactiy"){l.push(o[i1])}}}e=e.replace(s,l.join(";"));if(t&&t.svg){var g=t.svg.id;var h=2;var m=e.slice(-h);if(m!="/>"){h=3;m=e.slice(-h)}var b=e.slice(0,e.length-h);var v=' clip-path="url(#'+g+')" ';var w=i.gatherAttribute(t.svg,"class");w=w?w.split(" "):[];if(w.indexOf(i.setup.chart.classNamePrefix+"-graph-line")!=-1){e=b+v+m}else{e="<g "+v+">"+e+"</g>"}if(r.indexOf(g)==-1){var y=(new XMLSerializer).serializeToString(t.svg);a.push(y);r.push(g)}}return e}},e||{});var s;if(!i.handleNamespace("fabric",{scope:this,cb:i.toSVG,args:arguments})){return false}s=i.setup.fabric.toSVG(n,n.reviver);if(a.length){var o=s.slice(0,s.length-6);var l=s.slice(-6);s=o+a.join("")+l}if(n.compress){s=s.replace(/[\t\r\n]+/g,"")}if(n.getBase64){s="data:image/svg+xml;base64,"+btoa(s)}i.handleCallback(t,s,n);return s},toPDF:function(e,t){var a=i.deepMerge(i.deepMerge({multiplier:i.config.multiplier||2,pageOrigin:i.config.pageOrigin===undefined?true:false},i.config.pdfMake),e||{},true);var r;if(!i.handleNamespace("pdfMake",{scope:this,cb:i.toPDF,args:arguments})){return false}r=new pdfMake.createPdf(a);a.images.reference=i.toPNG(a);function n(e){if(typeof e==="number"||e instanceof Number){e={left:e,right:e,top:e,bottom:e}}else if(e instanceof Array){if(e.length===2){e={left:e[0],top:e[1],right:e[0],bottom:e[1]}}else if(e.length===4){e={left:e[0],top:e[1],right:e[2],bottom:e[3]}}else throw"Invalid pageMargins definition"}else{e={left:i.defaults.pdfMake.pageMargins,top:i.defaults.pdfMake.pageMargins,right:i.defaults.pdfMake.pageMargins,bottom:i.defaults.pdfMake.pageMargins}}return e}function s(e,t){var a=i.defaults.pdfMake.pageSizes[String(e).toUpperCase()].slice();if(!a){throw new Error('The given pageSize "'+e+'" does not exist!')}if(t=="landscape"){a.reverse()}return a}if(!a.content){var o=[];var l=s(a.pageSize,a.pageOrientation);var f=n(a.pageMargins);l[0]-=f.left+f.right;l[1]-=f.top+f.bottom;if(a.pageOrigin){o.push(i.i18l("label.saved.from"));o.push(window.location.href);l[1]-=14.064*2}o.push({image:"reference",fit:l});a.content=o}if(t){r.getDataUrl(function(e){return function(t){e.apply(i,arguments)}}(t))}return r},toPRINT:function(e,t){var a;var r=i.deepMerge({delay:.01,lossless:false},e||{});var n=i.toImage(r);var s=[];var o=document.body.childNodes;var l=document.documentElement.scrollTop||document.body.scrollTop;n.setAttribute("style","width: 100%; max-height: 100%;");for(a=0;a<o.length;a++){if(i.isElement(o[a])){s[a]=o[a].style.display;o[a].style.display="none"}}document.body.appendChild(n);setTimeout(function(){window.print();r.delay*=1e3;var e=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;if(e&&r.delay<1e3){r.delay=1e3}setTimeout(function(){for(a=0;a<o.length;a++){if(i.isElement(o[a])){o[a].style.display=s[a]}}document.body.removeChild(n);document.documentElement.scrollTop=document.body.scrollTop=l;i.handleCallback(t,n,r)},r.delay)},1);return n},toJSON:function(e,t){var a=i.deepMerge({dateFormat:i.config.dateFormat||"dateObject"},e||{},true);var r={};if(!i.handleNamespace("JSON",{scope:this,cb:i.toJSON,args:arguments})){return false}a.data=a.data!==undefined?a.data:i.getChartData(a);r=JSON.stringify(a.data,undefined,"	");i.handleCallback(t,r,a);return r},toCSV:function(e,t){var a,r;var n=i.deepMerge({delimiter:",",quotes:true,escape:true,withHeader:true},e||{},true);var s=[];var o="";s=i.toArray(n);for(a in s){if(!isNaN(a)){o+=s[a].join(n.delimiter)+"\n"}}i.handleCallback(t,o,n);return o},toXLSX:function(e,t){var a=i.deepMerge({name:"amCharts",dateFormat:i.config.dateFormat||"dateObject",withHeader:true,stringify:false},e||{},true);var r=[];var n="";var s={SheetNames:[],Sheets:{}};if(!i.handleNamespace("XLSX",{scope:this,cb:i.toXLSX,args:arguments})){return false}r=i.toArray(a);function o(e,t){if(t)e+=1462;var a=Date.parse(e);var i=e.getTimezoneOffset()*60*1e3;return(a-i-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3)}function l(e,t){var a={};var i={s:{c:1e7,r:1e7},e:{c:0,r:0}};for(var r=0;r!=e.length;++r){for(var n=0;n!=e[r].length;++n){if(i.s.r>r)i.s.r=r;if(i.s.c>n)i.s.c=n;if(i.e.r<r)i.e.r=r;if(i.e.c<n)i.e.c=n;var s={v:e[r][n]};if(s.v==null)continue;var l=XLSX.utils.encode_cell({c:n,r:r});if(typeof s.v==="number"){s.t="n"}else if(typeof s.v==="boolean"){s.t="b"}else if(s.v instanceof Date){s.t="n";s.z=XLSX.SSF._table[14];s.v=o(s.v)}else if(s.v instanceof Object){s.t="s";s.v=JSON.stringify(s.v)}else{s.t="s"}a[l]=s}}if(i.s.c<1e7)a["!ref"]=XLSX.utils.encode_range(i);return a}s.SheetNames.push(a.name);s.Sheets[a.name]=l(r);n=XLSX.write(s,{bookType:"xlsx",bookSST:true,type:"base64"});n="data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+n;i.handleCallback(t,n,a);return n},toArray:function(e,t){var a,r;var n=i.deepMerge({withHeader:false,stringify:true,escape:false,quotes:false},e||{},true);var s=[];var o=[];var l=[];var f=i.config.processData;function d(e,t){var a=t.exportFields||Object.keys(t.dataFieldsMap);for(r=0;r<a.length;r++){var n=a[r];var s=t.dataFieldsTitlesMap[n];o.push(s)}if(f){return i.handleCallback(f,e,t)}return e}function c(e){if(typeof e==="string"){if(n.escape){e=e.replace('"','""')}if(n.quotes){e=['"',e,'"'].join("")}}return e}n.processData=d;n.data=n.data!==undefined?i.processData(n):i.getChartData(n);if(n.withHeader){l=[];for(r in o){if(!isNaN(r)){l.push(c(o[r]))}}s.push(l)}for(a in n.data){l=[];if(!isNaN(a)){for(r in o){if(!isNaN(r)){var r=o[r];var u=n.data[a][r];if(u==null){u=""}else if(n.stringify){u=String(u)}else{u=u}l.push(c(u))}}s.push(l)}}i.handleCallback(t,s,n);return s},toByteArray:function(e,t){var a=i.deepMerge({},e||{});var r=typeof Uint8Array!=="undefined"?Uint8Array:Array;var n="+".charCodeAt(0);var s="/".charCodeAt(0);var o="0".charCodeAt(0);var l="a".charCodeAt(0);var f="A".charCodeAt(0);var d=u(a.data);function c(e){var t=e.charCodeAt(0);if(t===n)return 62;if(t===s)return 63;if(t<o)return-1;if(t<o+10)return t-o+26+26;if(t<f+26)return t-f;if(t<l+26)return t-l+26}function u(e){var t,a,i,n,s,o;if(e.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var l=e.length;s="="===e.charAt(l-2)?2:"="===e.charAt(l-1)?1:0;o=new r(e.length*3/4-s);i=s>0?e.length-4:e.length;var f=0;function d(e){o[f++]=e}for(t=0,a=0;t<i;t+=4,a+=3){n=c(e.charAt(t))<<18|c(e.charAt(t+1))<<12|c(e.charAt(t+2))<<6|c(e.charAt(t+3));d((n&16711680)>>16);d((n&65280)>>8);d(n&255)}if(s===2){n=c(e.charAt(t))<<2|c(e.charAt(t+1))>>4;d(n&255)}else if(s===1){n=c(e.charAt(t))<<10|c(e.charAt(t+1))<<4|c(e.charAt(t+2))>>2;d(n>>8&255);d(n&255)}return o}i.handleCallback(t,d,a);return d},handleCallback:function(e){var t,a=Array();if(e&&e instanceof Function){for(t=0;t<arguments.length;t++){if(t>0){a.push(arguments[t])}}return e.apply(i,a)}},handleLog:function(e){if(i.config.debug===true){console.log(e)}},handleNamespace:function(e,t){var a=i.config.scope||window;var r=false;var n=Number(new Date);var s;r=!!(e in a);function o(){var l=Number(new Date);r=!!(e in a);if(e=="pdfMake"&&r){r=a.pdfMake.vfs}if(r){clearTimeout(s);t.cb.apply(t.scope,t.args);i.handleLog(['AmCharts [export]: Namespace "',e,'" showed up in: ',String(a)].join(""))}else if(l-n<i.libs.loadTimeout){s=setTimeout(o,250)}else{i.handleLog(['AmCharts [export]: Gave up waiting for "',e,'" in: ',String(a)].join(""))}}if(!r){i.handleLog(['AmCharts [export]: Could not find "',e,'" in: ',String(a)].join(""));o()}return r},handleBorder:function(e){if(i.config.border instanceof Object){var t=i.deepMerge(i.defaults.fabric.border,e.border||{},true);var a=new fabric.Rect;t.width=i.setup.fabric.width-t.strokeWidth;t.height=i.setup.fabric.height-t.strokeWidth;a.set(t);i.setup.fabric.add(a)}},handleDropbox:function(e){if(i.drawing.enabled){e.preventDefault();e.stopPropagation();if(e.type=="dragover"){i.setup.wrapper.setAttribute("class",i.setup.chart.classNamePrefix+"-export-canvas active dropbox")}else{i.setup.wrapper.setAttribute("class",i.setup.chart.classNamePrefix+"-export-canvas active");if(e.type=="drop"&&e.dataTransfer.files.length){for(var t=0;t<e.dataTransfer.files.length;t++){var a=new FileReader;a.onloadend=function(t){return function(){i.drawing.handler.add({url:a.result,top:e.layerY-t*10,left:e.layerX-t*10})}}(t);a.readAsDataURL(e.dataTransfer.files[t])}}}}},handleReady:function(e){var t,a;var i=this;var r=Number(new Date);i.handleCallback(e,"data",false);for(filename in i.libs.namespaces){var n=i.libs.namespaces[filename];(function(t){var a=setInterval(function(){var n=Number(new Date);if(n-r>i.libs.loadTimeout||t in window){clearTimeout(a);i.handleCallback(e,t,n-r>i.libs.loadTimeout)}},AmCharts.updateRate)})(n)}},getChartData:function(e){var t=i.deepMerge({data:[],titles:{},dateFields:[],dataFields:[],dataFieldsMap:{},exportTitles:i.config.exportTitles,exportFields:i.config.exportFields,exportSelection:i.config.exportSelection,columnNames:i.config.columnNames},e||{},true);var a,r,n,s;var o=["valueField","openField","closeField","highField","lowField","xField","yField"];var l;function f(e,r,n){function s(e,a){if(t.dataFields.indexOf(e)!=-1){return s([e,".",a].join(""))}return e}if(e&&t.exportTitles&&i.setup.chart.type!="gantt"){a=s(e,n);t.dataFieldsMap[a]=e;t.dataFields.push(a);t.titles[a]=r||a}}if(t.data.length==0){if(i.setup.chart.type=="stock"){t.data=i.cloneObject(i.setup.chart.mainDataSet.dataProvider);f(i.setup.chart.mainDataSet.categoryField);t.dateFields.push(i.setup.chart.mainDataSet.categoryField);for(r=0;r<i.setup.chart.mainDataSet.fieldMappings.length;r++){var d=i.setup.chart.mainDataSet.fieldMappings[r];for(n=0;n<i.setup.chart.panels.length;n++){var c=i.setup.chart.panels[n];for(s=0;s<c.stockGraphs.length;s++){var u=c.stockGraphs[s];for(i4=0;i4<o.length;i4++){if(u[o[i4]]==d.toField){f(d.fromField,u.title,o[i4])}}}}}if(i.setup.chart.comparedGraphs.length){l=[];for(r=0;r<t.data.length;r++){l.push(t.data[r][i.setup.chart.mainDataSet.categoryField])}for(r=0;r<i.setup.chart.comparedGraphs.length;r++){var u=i.setup.chart.comparedGraphs[r];for(n=0;n<u.dataSet.dataProvider.length;n++){var p=u.dataSet.categoryField;var g=u.dataSet.dataProvider[n][p];var h=l.indexOf(g);if(h!=-1){for(s=0;s<u.dataSet.fieldMappings.length;s++){var d=u.dataSet.fieldMappings[s];var a=u.dataSet.id+"_"+d.toField;t.data[h][a]=u.dataSet.dataProvider[n][d.fromField];if(!t.titles[a]){f(a,u.dataSet.title)}}}}}}}else if(i.setup.chart.type=="gantt"){f(i.setup.chart.categoryField);var m=i.setup.chart.segmentsField;for(r=0;r<i.setup.chart.dataProvider.length;r++){var b=i.setup.chart.dataProvider[r];if(b[m]){for(n=0;n<b[m].length;n++){b[m][n][i.setup.chart.categoryField]=b[i.setup.chart.categoryField];t.data.push(b[m][n])}}}for(r=0;r<i.setup.chart.graphs.length;r++){var u=i.setup.chart.graphs[r];for(n=0;n<o.length;n++){var v=o[n];var w=u[v];var y=u.title;f(w,u.title,v)}}}else if(["pie","funnel"].indexOf(i.setup.chart.type)!=-1){t.data=i.setup.chart.dataProvider;f(i.setup.chart.titleField);t.dateFields.push(i.setup.chart.titleField);f(i.setup.chart.valueField)}else if(i.setup.chart.type!="map"){t.data=i.setup.chart.dataProvider;if(i.setup.chart.categoryAxis){f(i.setup.chart.categoryField,i.setup.chart.categoryAxis.title);if(i.setup.chart.categoryAxis.parseDates!==false){t.dateFields.push(i.setup.chart.categoryField)}}for(r=0;r<i.setup.chart.graphs.length;r++){var u=i.setup.chart.graphs[r];for(n=0;n<o.length;n++){var v=o[n];var w=u[v];f(w,u.title,v)}}}}return i.processData(t)},getAnnotations:function(e,t){var a=i.deepMerge({},e||{},true);var r;var n=[];for(r=0;r<i.setup.fabric._objects.length;r++){if(!i.setup.fabric._objects[r].isCoreElement){var s=i.setup.fabric._objects[r].toJSON();i.handleCallback(a.reviver,s,r);n.push(s)}}i.handleCallback(t,n);return n},setAnnotations:function(e,t){var a=i.deepMerge({data:[]},e||{},true);fabric.util.enlivenObjects(a.data,function(e){e.forEach(function(e,t){i.handleCallback(a.reviver,e,t);i.setup.fabric.add(e)});i.handleCallback(t,a)});return a.data},processData:function(t){var a=i.deepMerge({data:[],titles:{},dateFields:[],dataFields:[],dataFieldsMap:{},dataFieldsTitlesMap:{},dataDateFormat:i.setup.chart.dataDateFormat,dateFormat:i.config.dateFormat||i.setup.chart.dataDateFormat||"YYYY-MM-DD",exportTitles:i.config.exportTitles,exportFields:i.config.exportFields,exportSelection:i.config.exportSelection,columnNames:i.config.columnNames,processData:i.config.processData},t||{},true);var r,n;if(a.data.length){for(r=0;r<a.data.length;r++){for(n in a.data[r]){if(a.dataFields.indexOf(n)==-1){a.dataFields.push(n);a.dataFieldsMap[n]=n}}}if(a.exportFields!==undefined){a.dataFields=a.exportFields.filter(function(e){return a.dataFields.indexOf(e)!=-1})}var s=[];for(r=0;r<a.data.length;r++){var o={};var l=false;for(n=0;n<a.dataFields.length;n++){var f=a.dataFields[n];var d=a.dataFieldsMap[f];var c=a.columnNames&&a.columnNames[f]||a.titles[f]||f;var u=a.data[r][d];if(u==null){u=undefined}if(a.exportTitles&&i.setup.chart.type!="gantt"){if(c in o){c+=["( ",f," )"].join("")}}if(a.dateFields.indexOf(d)!=-1){if(a.dataDateFormat&&(u instanceof String||typeof u=="string")){u=AmCharts.stringToDate(u,a.dataDateFormat)}else if(a.dateFormat&&(u instanceof Number||typeof u=="number")){u=new Date(u)}if(a.exportSelection){if(u instanceof Date){if(u<e.startDate||u>e.endDate){l=true}}else if(r<e.startIndex||r>e.endIndex){l=true}}if(a.dateFormat&&a.dateFormat!="dateObject"&&u instanceof Date){u=AmCharts.formatDate(u,a.dateFormat)}}a.dataFieldsTitlesMap[d]=c;o[c]=u}if(!l){s.push(o)}}a.data=s}if(a.processData!==undefined){a.data=i.handleCallback(a.processData,a.data,a)}return a.data},capitalize:function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},createMenu:function(t,a){var r;var n=[];function s(t,a){var r,o,l=document.createElement("ul");for(r=0;r<t.length;r++){var f=typeof t[r]==="string"?{format:t[r]}:t[r];var d=document.createElement("li");var c=document.createElement("a");var u=document.createElement("img");var p=document.createElement("span");var g=String(f.action?f.action:f.format).toLowerCase();f.format=String(f.format).toUpperCase();d.addEventListener("mouseleave",function(e){this.classList.remove("active")});c.addEventListener("focus",function(e){if(!i.setup.hasTouch){i.setup.focusedMenuItem=this;var t=this.parentNode;if(t.tagName!="UL"){t=t.parentNode}var a=t.getElementsByTagName("li");for(r=0;r<a.length;r++){a[r].classList.remove("active")}this.parentNode.classList.add("active");this.parentNode.parentNode.parentNode.classList.add("active")}});if(i.config.formats[f.format]){f=i.deepMerge({label:f.icon?"":f.format,format:f.format,mimeType:i.config.formats[f.format].mimeType,extension:i.config.formats[f.format].extension,capture:i.config.formats[f.format].capture,action:i.config.action,fileName:i.config.fileName},f)}else if(!f.label){f.label=f.label?f.label:i.i18l("menu.label."+g)}if(["CSV","JSON","XLSX"].indexOf(f.format)!=-1&&["map","gauge"].indexOf(i.setup.chart.type)!=-1){continue}else if(!i.setup.hasBlob&&f.format!="UNDEFINED"){if(f.mimeType&&f.mimeType.split("/")[0]!="image"&&f.mimeType!="text/plain"){continue}}if(f.action=="draw"){if(i.config.fabric.drawing.enabled){f.menu=f.menu?f.menu:i.config.fabric.drawing.menu;f.click=function(e){return function(){this.capture(e,function(){this.createMenu(e.menu)})}}(f)}else{f.menu=[]}}else if(!f.populated&&f.action&&f.action.indexOf("draw.")!=-1){var h=f.action.split(".")[1];var m=f[h]||i.config.fabric.drawing[h]||[];f.menu=[];f.populated=true;for(o=0;o<m.length;o++){var b={label:m[o]};if(h=="shapes"){var v=m[o].indexOf("//")==-1;var w=(v?i.config.path+"shapes/":"")+m[o];b.action="add";b.url=w;b.icon=w;b.ignore=v;b["class"]="export-drawing-shape"}else if(h=="colors"){b.style="background-color: "+m[o];b.action="change";b.color=m[o];b["class"]="export-drawing-color"}else if(h=="widths"){b.action="change";b.width=m[o];b.label=document.createElement("span");b.label.style.width=i.numberToPx(m[o]);b.label.style.height=i.numberToPx(m[o]);b["class"]="export-drawing-width"}else if(h=="opacities"){b.style="opacity: "+m[o];b.action="change";b.opacity=m[o];b.label=m[o]*100+"%";b["class"]="export-drawing-opacity"}else if(h=="modes"){b.label=i.i18l("menu.label.draw.modes."+m[o]);b.click=function(e){return function(){i.drawing.mode=e}}(m[o]);b["class"]="export-drawing-mode"}f.menu.push(b)}}else if(!f.click&&!f.menu&&!f.items){if(i.drawing.handler[g]instanceof Function){f.action=g;f.click=function(e){return function(){this.drawing.handler[e.action](e);if(e.action!="cancel"){this.createMenu(this.config.fabric.drawing.menu)}}}(f)}else if(i.drawing.enabled){f.click=function(e){return function(){if(this.config.drawing.autoClose){this.drawing.handler.done()}this["to"+e.format](e,function(t){if(e.action=="download"){this.download(t,e.mimeType,[e.fileName,e.extension].join("."))}})}}(f)}else if(f.format!="UNDEFINED"){f.click=function(e){return function(){if(e.capture||e.action=="print"||e.format=="PRINT"){this.capture(e,function(){this.drawing.handler.done();this["to"+e.format](e,function(t){if(e.action=="download"){this.download(t,e.mimeType,[e.fileName,e.extension].join("."));this.createMenu(this.config.menu)}})})}else if(this["to"+e.format]){this["to"+e.format](e,function(t){this.download(t,e.mimeType,[e.fileName,e.extension].join("."));this.createMenu(this.config.menu)})}else{throw new Error("Invalid format. Could not determine output type.")}}}(f)}}if(f.menu!==undefined&&!f.menu.length){continue}c.setAttribute("href","#");c.addEventListener("click",function(e,t){return function(a){a.preventDefault();var r=[a,t];if((t.action=="draw"||t.format=="PRINT"||t.format!="UNDEFINED"&&t.capture)&&!i.drawing.enabled){if(!isNaN(t.delay)||!isNaN(i.config.delay)){t.delay=!isNaN(t.delay)?t.delay:i.config.delay;i.delay(t,e);return}}e.apply(i,r)}}(f.click||function(e){e.preventDefault()},f));if(i.setup.hasTouch&&d.classList){c.addEventListener("click",function(e){return function(t){t.preventDefault();var a=e.elements.li;var s=f(a);var o=d(a);var l=c(a);function f(e){var t=e.parentNode.parentNode;var a=t.classList;if(t.tagName=="LI"&&a.contains("active")){return true}return false}function d(e){var t=e.parentNode.children;for(r=0;r<t.length;r++){var a=t[r];var i=a.classList;if(a!==e&&i.contains("active")){i.remove("active");return true}}return false}function c(e){return e.getElementsByTagName("ul").length>0}function u(e){return e.classList.contains("export-main")||e.classList.contains("export-drawing")}if(u(a)||!l){i.setup.menu.classList.toggle("active")}if(!s||!l){while(n.length){var p=n.pop();var g=u(p);var h=p!==a;if(g){if(!l){p.classList.remove("active")}}else if(h){p.classList.remove("active")}}}n.push(a);if(l){a.classList.toggle("active")}}}(f))}d.appendChild(c);if(i.isElement(f.label)){p.appendChild(f.label)}else{p.innerHTML=f.label}if(f["class"]){d.className=f["class"]}if(f.style){d.setAttribute("style",f.style)}if(f.icon){u.setAttribute("src",(!f.ignore&&f.icon.slice(0,10).indexOf("//")==-1?e.pathToImages:"")+f.icon);c.appendChild(u)}if(f.label){c.appendChild(p)}if(f.title){c.setAttribute("title",f.title)}if(i.config.menuReviver){d=i.config.menuReviver.apply(i,[f,d])}f.elements={li:d,a:c,img:u,span:p};if((f.menu||f.items)&&f.action!="draw"){if(s(f.menu||f.items,d).childNodes.length){l.appendChild(d)}}else{l.appendChild(d)}}if(l.childNodes.length){a.appendChild(l)}return l}if(!a){if(typeof i.config.divId=="string"){i.config.divId=a=document.getElementById(i.config.divId)}else if(i.isElement(i.config.divId)){a=i.config.divId}else{a=i.setup.chart.containerDiv}}if(i.isElement(i.setup.menu)){i.setup.menu.innerHTML=""}else{i.setup.menu=document.createElement("div")}i.setup.menu.setAttribute("class",i.setup.chart.classNamePrefix+"-export-menu "+i.setup.chart.classNamePrefix+"-export-menu-"+i.config.position+" amExportButton");if(i.config.menuWalker){s=i.config.menuWalker}s.apply(this,[t,i.setup.menu]);if(i.setup.menu.childNodes.length){a.appendChild(i.setup.menu)}return i.setup.menu},delay:function(e,t){var a=i.deepMerge({delay:3,precision:2},e||{});var r,n,s=Number(new Date);var o=i.createMenu([{label:i.i18l("capturing.delayed.menu.label").replace("{{duration}}",AmCharts.toFixed(a.delay,a.precision)),title:i.i18l("capturing.delayed.menu.title"),"class":"export-delayed-capturing",click:function(){clearTimeout(r);clearTimeout(n);i.createMenu(i.config.menu)}}]);var l=o.getElementsByTagName("a")[0];r=setInterval(function(){var e=a.delay-(Number(new Date)-s)/1e3;if(e<=0){clearTimeout(r);if(a.action!="draw"){i.createMenu(i.config.menu)}}else if(l){l.innerHTML=i.i18l("capturing.delayed.menu.label").replace("{{duration}}",AmCharts.toFixed(e,2))}},AmCharts.updateRate);n=setTimeout(function(){t.apply(i,arguments)},a.delay*1e3)},migrateSetup:function(e){var t={enabled:true,migrated:true,libs:{autoLoad:true},menu:[]};function a(e){var i;for(i in e){var r=e[i];if(i.slice(0,6)=="export"&&r){t.menu.push(i.slice(6))}else if(i=="userCFG"){a(r)}else if(i=="menuItems"){t.menu=r}else if(i=="libs"){t.libs=r}else if(typeof i=="string"){t[i]=r}}}a(e);return t},clear:function(){i.setup=undefined;if(i.docListener){document.removeEventListener("keydown",i.docListener)}var e=i.listenersToRemove;if(e){for(var t=0;t<e.length;t++){var a=e[t];a.node.removeEventListener(a.event,a.method)}}i.listenersToRemove=[]},loadListeners:function(){function e(e){if(e){e.set({top:e.top+10,left:e.left+10});i.setup.fabric.add(e)}}if(i.config.keyListener&&i.config.keyListener!="attached"){i.docListener=function(t){var a=i.drawing.buffer.target;var r=[37,38,39,40,13,9,27];var n=["top-left","bottom-left"].indexOf(i.config.position)!=-1;var s=["top-right","bottom-right"].indexOf(i.config.position)!=-1;function o(e,t){for(i1=0;i1<e.length;i1++){var a=e[i1];a.parentNode.classList.remove("active");if(i1==0&&!t){a.focus()}}}function l(e){if(i.setup.focusedMenuItem&&i.setup.focusedMenuItem.nextSibling){i.setup.focusedMenuItem.parentNode.classList.add("active");o(i.setup.focusedMenuItem.nextSibling.getElementsByTagName("a"),e)}}function f(e){if(i.setup.focusedMenuItem&&i.setup.focusedMenuItem.parentNode.parentNode.parentNode){i.setup.focusedMenuItem.parentNode.classList.add("active");o(i.setup.focusedMenuItem.parentNode.parentNode.parentNode.getElementsByTagName("a"),e)}}function d(e){if(i.setup.focusedMenuItem&&i.setup.focusedMenuItem.parentNode.nextSibling){i.setup.focusedMenuItem.parentNode.classList.remove("active");o(i.setup.focusedMenuItem.parentNode.nextSibling.getElementsByTagName("a"),e)}}function c(e){if(i.setup.focusedMenuItem&&i.setup.focusedMenuItem.parentNode.previousSibling){i.setup.focusedMenuItem.parentNode.classList.remove("active");o(i.setup.focusedMenuItem.parentNode.previousSibling.getElementsByTagName("a"),e)}}function u(){function e(t){if(i.isElement(t)){t.blur();if(t.parentNode){t.parentNode.classList.remove("active")}if(!t.classList.contains("amExportButton")){e(t.parentNode)}}}if(i.setup.focusedMenuItem){e(i.setup.focusedMenuItem);i.setup.focusedMenuItem=undefined}}if(i.setup.focusedMenuItem&&r.indexOf(t.keyCode)!=-1){if(t.keyCode==9){if(!i.setup.focusedMenuItem.nextSibling){i.setup.focusedMenuItem.parentNode.classList.remove("active");if(!i.setup.focusedMenuItem.parentNode.nextSibling){i.setup.focusedMenuItem.parentNode.classList.remove("active");i.setup.focusedMenuItem.parentNode.parentNode.parentNode.classList.remove("active")}}else if(t.shiftKey){i.setup.focusedMenuItem.parentNode.classList.remove("active")}return}if(t.keyCode==13&&i.setup.focusedMenuItem.nextSibling){l()}if(t.keyCode==37){if(s){l()}else{f()}}if(t.keyCode==39){if(s){f()}else{l()}}if(t.keyCode==40){d()}if(t.keyCode==38){c()}if(t.keyCode==27){u()}}if((t.keyCode==8||t.keyCode==46)&&a){t.preventDefault();i.setup.fabric.remove(a)}else if(t.keyCode==27&&i.drawing.enabled){t.preventDefault();if(i.drawing.buffer.isSelected){i.setup.fabric.discardActiveObject()}else{i.drawing.handler.done()}}else if(t.keyCode==67&&(t.metaKey||t.ctrlKey)&&a){i.drawing.buffer.copy=a}else if(t.keyCode==88&&(t.metaKey||t.ctrlKey)&&a){i.drawing.buffer.copy=a;i.setup.fabric.remove(a)}else if(t.keyCode==86&&(t.metaKey||t.ctrlKey)){if(i.drawing.buffer.copy){e(i.drawing.buffer.copy.clone(e))}}else if(t.keyCode==90&&(t.metaKey||t.ctrlKey)){t.preventDefault();if(t.shiftKey){i.drawing.handler.redo()}else{i.drawing.handler.undo()}}};i.config.keyListener="attached";document.addEventListener("keydown",i.docListener)}if(i.config.fileListener){i.setup.chart.containerDiv.addEventListener("dragover",i.handleDropbox);i.setup.chart.containerDiv.addEventListener("dragleave",i.handleDropbox);i.setup.chart.containerDiv.addEventListener("drop",i.handleDropbox)}},init:function(){clearTimeout(a);a=setInterval(function(){if(i.setup&&i.setup.chart.containerDiv){clearTimeout(a);if(i.config.enabled){i.setup.chart.AmExport=i;if(i.config.overflow){i.setup.chart.div.style.overflow="visible"}i.loadListeners();i.createMenu(i.config.menu);i.handleReady(i.config.onReady)}}},AmCharts.updateRate)},construct:function(){i.drawing.handler.cancel=i.drawing.handler.done;try{i.setup.hasBlob=!!new Blob}catch(e){}window.safari=window.safari?window.safari:{};i.defaults.fabric.drawing.fontSize=i.setup.chart.fontSize||11;i.config.drawing=i.deepMerge(i.defaults.fabric.drawing,i.config.drawing||{},true);if(i.config.border){i.config.border=i.deepMerge(i.defaults.fabric.border,i.config.border||{},true)}i.deepMerge(i.defaults.fabric,i.config,true);i.deepMerge(i.defaults.fabric,i.config.fabric||{},true);i.deepMerge(i.defaults.pdfMake,i.config,true);i.deepMerge(i.defaults.pdfMake,i.config.pdfMake||{},true);i.deepMerge(i.libs,i.config.libs||{},true);i.config.drawing=i.defaults.fabric.drawing;i.config.fabric=i.defaults.fabric;i.config.pdfMake=i.defaults.pdfMake;i.config=i.deepMerge(i.defaults,i.config,true);if(i.config.fabric.drawing.enabled){if(i.config.fabric.drawing.menu===undefined){i.config.fabric.drawing.menu=[];i.deepMerge(i.config.fabric.drawing.menu,[{"class":"export-drawing",menu:[{label:i.i18l("menu.label.draw.add"),menu:[{label:i.i18l("menu.label.draw.shapes"),action:"draw.shapes"},{label:i.i18l("menu.label.draw.text"),action:"text"}]},{label:i.i18l("menu.label.draw.change"),menu:[{label:i.i18l("menu.label.draw.modes"),action:"draw.modes"},{label:i.i18l("menu.label.draw.colors"),action:"draw.colors"},{label:i.i18l("menu.label.draw.widths"),action:"draw.widths"},{label:i.i18l("menu.label.draw.opacities"),action:"draw.opacities"},"UNDO","REDO"]},{label:i.i18l("menu.label.save.image"),menu:["PNG","JPG","SVG","PDF"]},"PRINT","CANCEL"]}])}}if(i.config.menu===undefined){i.config.menu=[];i.deepMerge(i.config,{menu:[{"class":"export-main",menu:[{label:i.i18l("menu.label.save.image"),menu:["PNG","JPG","SVG","PDF"]},{label:i.i18l("menu.label.save.data"),menu:["CSV","XLSX","JSON"]},{label:i.i18l("menu.label.draw"),action:"draw",menu:i.config.fabric.drawing.menu},{format:"PRINT",label:i.i18l("menu.label.print")}]}]})}if(!i.libs.path){i.libs.path=i.config.path+"libs/"}if(i.isSupported()){i.loadDependencies(i.libs.resources,i.libs.reload);i.setup.chart.addClassNames=true;i.setup.chart[i.name]=i;i.init()}}};if(t){i.config=t}else if(i.setup.chart[i.name]){i.config=i.setup.chart[i.name]}else if(i.setup.chart.amExport||i.setup.chart.exportConfig){i.config=i.migrateSetup(i.setup.chart.amExport||i.setup.chart.exportConfig)}else{return}i.construct();return i.deepMerge(this,i)}})();AmCharts.addInitHandler(function(e){new AmCharts["export"](e)},["pie","serial","xy","funnel","radar","gauge","stock","map","gantt"]);
//# sourceMappingURL=export.map.js